/*
 * @Author: your name
 * @Date: 2021-01-22 17:16:58
 * @LastEditTime: 2021-01-28 16:14:09
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \wxapp\pages\vehicle\person\order-detail\order-detail.js
 */
  var t = getApp(),
  a = t.requirejs("core");
Page({
    data: {
        order:{}
    },
    cancelOrder() {
        let i = 0;
        new Promise(function (resolve, reject) {
            wx.showModal({
                title: '提示',
                content: '是否取消订单',
                showCancel: true,
                cancelText: '取消',
                cancelColor: '#000000',
                confirmText: '确定',
                confirmColor: '#3CC51F',
                success: (result) => {
                    if (result.confirm) {
                        i++;
                        resolve(i++);
                    }
                },
                fail: () => { },
                complete: () => { }
            });
        }).then(function (result) {
            console.log('result', result);
        });

    },
    payOrder(t) {
        var  id = a.pdata(t).id;
        wx.navigateTo({
            url: '/pages/vehicle/order/pay/index?id='+id,
        });
    }, onLoad: function (option) {
      this.getDetail(option)
    },
    getDetail: function (s) {
        var t = this;
           a.get("vehicle/order/detail", {
            id:s.id
          }, function (a) {

                t.setData({
                    order: a.order
                })
                console.log(a)
          })
    },

})